package pl.th.permission.plugin.node.annotation;

import org.objectweb.asm.Type;

import pl.th.permission.plugin.Utils;

public class NeedAnnotation extends PartAnnotation{

    protected Type mProxyType;

    public NeedAnnotation() {
        super(AnnType.NEED_PERMISSION);
    }

    public Type getClzType() {
        return mProxyType == null ? Utils.PROXY_TYPE : mProxyType;
    }

    @Override
    public void visit(String name, Object value) {
        super.visit(name, value);
        if (Utils.PROXY_CLZ_NAME.equals(name)) {
            mProxyType = (Type) value;
        }
    }

    @Override
    public boolean checkAnnotationType(AnnType type) {
        return type == AnnType.NEED_PERMISSION;
    }

    @Override
    public String getMethodDesc() {
        return null;
    }


}
